package com.congee02.springframework.beans.factory;

import com.congee02.springframework.beans.BeansException;

import java.util.Map;

/**
 * Extension of the {@link BeanFactory} interface to be implemented by bean factories
 * that can enumerate all their bean instances, rather than attempting bean lookup
 * by name one by one as requested by clients. BeanFactory implementations that
 * preload all their bean definitions (such as XML-based factories) may implement
 * this interface.
 *
 * 对 接口BeanFactory 的扩展，允许枚举所有的 bean 实例，而不是使用 beanName 来一个一个查询客户端所需要的 bean。
 *
 */
public interface ListableBeanFactory extends BeanFactory {

    /**
     * 按类型返回 bean 实例
     */
    <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException;

    /**
     * 返回ioc容器中注册的所有 bean 名称
     */
    String[] getBeanDefinitionNames();



}
